using System;
using System.IO;

namespace TDUnit.Loggers
{
    public class FileLogger : StreamLogger
    {
        public FileLogger()
            : this(string.Format("{0}_TDUnit.log", DateTime.Now.ToString("yyyyMMddhhmmss")))
        {
        }

        public FileLogger(string logFilePath) 
            : this(logFilePath, false)
        {
        }

        public FileLogger(string logFilePath, bool append) 
            : base(File.Open(logFilePath, append ? FileMode.Append : FileMode.Create))
        {
            LogFile = logFilePath;
        }

        public string LogFile { get; private set; }
    }
}